<template>
  <div id="timeline">
    <div class="block">
      <div class="radio">
        排序
        <el-radio-group v-model="reverse">
          <el-radio :label="true">倒序</el-radio>
          <el-radio :label="false">正序</el-radio>
        </el-radio-group>
      </div>
      <hr>
      <el-timeline :reverse="reverse">
        <el-timeline-item v-for="(activity, index) in activities" :key="index" :timestamp="activity.timestamp">
          {{ activity.content }}
        </el-timeline-item>
      </el-timeline>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      reverse: true,
      activities: [
        {
          content: '活动开始',
          timestamp: '2018-03-06'
        },
        {
          content: '活动中',
          timestamp: '2018-03-08'
        },
        {
          content: '活动结束',
          timestamp: '2018-03-09'
        }
      ]
    }
  }
}
</script>
